package com.itheima.api.hashmap.demo04;

import java.util.Objects;

public class Student {

    private String name;
    private int age;
    private String adress;
    private String weapon;

    public Student() {
    }

    public Student(String name, int age, String adress, String weapon) {
        this.name = name;
        this.age = age;
        this.adress = adress;
        this.weapon = weapon;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAdress() {
        return adress;
    }

    public void setAdress(String adress) {
        this.adress = adress;
    }

    public String getWeapon() {
        return weapon;
    }

    public void setWeapon(String weapon) {
        this.weapon = weapon;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return age == student.age &&
                Objects.equals(name, student.name) &&
                Objects.equals(adress, student.adress) &&
                Objects.equals(weapon, student.weapon);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, adress, weapon);
    }
}
